home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Files / XTND 1.3.6 / Application Examples / PascalSource / XTEStyleSampleGlue.a < prev   
Encoding:
Text File  |  1989-09-29  |  2.7 KB  |  79 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    Apple Macintosh Developer Technical Support
  3. ;
  4. ;    MultiFinder-Aware TextEdit Sample Application
  5. ;
  6. ;    TEStyleSample
  7. ;
  8. ;    TEStyleSampleGlue.a    -    Assembler Source
  9. ;
  10. ;    Copyright © 1988 Apple Computer, Inc.
  11. ;    All rights reserved.
  12. ;
  13. ;    Versions:    1.0                        10/89
  14. ;
  15. ;    Components:    TEStyleSample.p            October    1, 1989
  16. ;                TEStyleSampleGlue.a        October    1, 1989
  17. ;                TEStyleSample.r            October    1, 1989
  18. ;                TEStyleSample.h            October    1, 1989
  19. ;                PTEStyleSample.make        October    1, 1989
  20. ;
  21. ;    TEStyleSample is an example application that demonstrates how 
  22. ;    to initialize the commonly used toolbox managers, operate 
  23. ;    successfully under MultiFinder, handle desk accessories and 
  24. ;    create, grow, and zoom windows. The fundamental TextEdit 
  25. ;    toolbox calls and TextEdit autoscroll are demonstrated. It 
  26. ;    also shows how to create and maintain scrollbar controls as well
  27. ;    as implementing a basic printing loop.
  28. ;
  29. ;    It does not by any means demonstrate all the techniques you 
  30. ;    need for a large application. In particular, TEStyleSample does not 
  31. ;    cover exception handling, multiple windows/documents, 
  32. ;    sophisticated memory management, printing, or undo. All of 
  33. ;    these are vital parts of a normal full-sized application.
  34. ;
  35. ;    This application is an example of the form of a Macintosh 
  36. ;    application; it is NOT a template. It is NOT intended to be 
  37. ;    used as a foundation for the next world-class, best-selling, 
  38. ;    600K application. A stick figure drawing of the human body may 
  39. ;    be a good example of the form for a painting, but that does not 
  40. ;    mean it should be used as the basis for the next Mona Lisa.
  41. ;
  42. ;    We recommend that you review this program or Sample before 
  43. ;    beginning a new application. Sample is a simple app. which doesn’t 
  44. ;    use TextEdit or the Control Manager.
  45. ;
  46.  
  47. ;
  48. ;    AsmClikLoop
  49. ;
  50. ;    This routine gets called by the TextEdit Manager from TEClick.
  51. ;    It calls the old, default click loop routine that scrolls the
  52. ;    text, and then calls our own Pascal routine that handles
  53. ;    tracking the scroll bars to follow along.  It doesn't bother
  54. ;    with saving registers A0 and D0, because they are trashed
  55. ;    anyway by TextEdit.
  56. ;
  57.  
  58. AsmClikLoop    PROC        EXPORT
  59.  
  60.             IMPORT        GETOLDCLIKLOOP
  61.             IMPORT        PASCALCLIKLOOP
  62.             
  63.             MOVEM.L        D1-D2/A1,-(SP)        ; D0 and A0 need not be saved
  64.             CLR.L        -(SP)                ; make space for procedure pointer
  65.             JSR            GETOLDCLIKLOOP        ; get the old clikLoop
  66.             MOVEA.L        (SP)+,A0            ; into A0
  67.             MOVEM.L        (SP)+,D1-D2/A1        ; restore the world as it was
  68.             
  69.             JSR            (A0)                ; and execute old clikLoop
  70.  
  71.             MOVEM.L        D1-D2/A1,-(SP)        ; D0 and A0 need not be saved
  72.             JSR            PASCALCLIKLOOP        ; do our clikLoop
  73.             MOVEM.L        (SP)+,D1-D2/A1        ; restore the world as it was
  74.             MOVEQ        #1,D0                ; clear the zero flag so TextEdit keeps going
  75.             RTS
  76.  
  77.             END 
  78.  
  79.